package exercise2;

import javax.swing.JOptionPane;

public class Cylinder {
	public static void printCyliner() {
		String in = JOptionPane.showInputDialog("请输入圆柱的的半径：");
		float radius = Float.parseFloat(in);
		JOptionPane.showInputDialog("请输入圆柱的长度：");
		float length = Float.parseFloat(in);
		float area = (float) (radius * radius * 3.14);
		float volumn = area * length;
		JOptionPane.showMessageDialog(null, "圆柱的底面积为：" + area + "\n" + "圆柱的体积为：" + volumn);
	}
}
